﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MailSender.Forms
{
	public partial class SenderSettings : Form
	{
		public SenderSettings()
		{
			InitializeComponent();

			this.tbUserName.Text = Utils.UserData.Current.mail_username;
			this.tbPassword.Text = Utils.UserData.Current.mail_password;
			this.tbServer.Text = Utils.UserData.Current.mail_server;
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
		}

		private void btnOK_Click(object sender, EventArgs e)
		{
			Utils.UserData.Current.mail_username = tbUserName.Text;
			Utils.UserData.Current.mail_password = tbPassword.Text;
			Utils.UserData.Current.mail_server = tbServer.Text;

			Utils.UserData.Current.Save();
			this.DialogResult = System.Windows.Forms.DialogResult.OK;
		}
	}
}
